<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改行车日志')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-driving-edit" th:object="${amDriving}">
            <input name="drivingId" th:field="*{drivingId}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">姓名：</label>
                <div class="col-sm-8">
                    <input name="name" th:field="*{name}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">车牌号码：</label>
                <div class="col-sm-8">
                    <input name="carId" th:field="*{carId}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">日期：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="drivingTime" th:value="${#dates.format(amDriving.drivingTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">班次：</label>
                <div class="col-sm-8">
                    <input name="orders" th:field="*{orders}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">市内加油：</label>
                <div class="col-sm-8">
                    <input name="jijiu" th:field="*{jijiu}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">空车：</label>
                <div class="col-sm-8">
                    <input name="zhuanyuan" th:field="*{zhuanyuan}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">市内出车：</label>
                <div class="col-sm-8">
                    <input name="chuyuan" th:field="*{chuyuan}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">长途：</label>
                <div class="col-sm-8">
                    <input name="trip" th:field="*{trip}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">收车里程：</label>
                <div class="col-sm-8">
                    <input name="mile" th:field="*{mile}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">总收入：</label>
                <div class="col-sm-8">
                    <input name="income" th:field="*{income}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">长途收入：</label>
                <div class="col-sm-8">
                    <input name="tripIncome" th:field="*{tripIncome}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">问题与处置：</label>
                <div class="col-sm-8">
                    <input name="problem" th:field="*{problem}" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "am/driving";
        $("#form-driving-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-driving-edit').serialize());
            }
        }

        $("input[name='drivingTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>